import { HostEnum, type GameJson } from "~/utils";
import { getServerCache } from "../plugins/cache";

/** 获取首页120个游戏列表 */
export default defineEventHandler(async (event): Promise<GameJson[]> => {
  const { hostName = HostEnum.localhost } = await readBody(event);
  const config = getServerCache().gameJsonDataSource[hostName];
  const { homeGameJson = [] } = config || {};
  return homeGameJson;
});
